﻿<?xml version="1.0" encoding="utf-8"?>
<xsd:schema id="ConstructSchema" targetNamespace="http://schemas.microsoft.com/dsltools/Construct" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/dsltools/Construct" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <!-- NamedElement -->
  <xsd:element name="namedElement" abstract="true" type="NamedElement" />
  <xsd:complexType name="NamedElement" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>Overall base class that provides every element with a Name property which acts as its MonikerKey for serialization.</xsd:documentation>
    </xsd:annotation>
    <!-- Property: Name -->
    <xsd:attribute name="name" type="xsd:string" use="required" />
  </xsd:complexType>
  
  <!-- NamedElement Moniker -->
  <xsd:element name="namedElementMoniker" abstract="true" type="NamedElementMoniker" />
  <xsd:complexType name="NamedElementMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for NamedElement instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="name" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- FlowGraph -->
  <xsd:element name="flowGraph" type="FlowGraph" substitutionGroup="namedElement" />
  <xsd:complexType name="FlowGraph">
    <xsd:annotation>
      <xsd:documentation>Root element in which others are embedded.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="NamedElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Relationship: FlowGraphHasComments -->
          <xsd:element name="comments" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of FlowGraphHasComments</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:choice minOccurs="0" maxOccurs="unbounded" >
                  <xsd:element ref="flowGraphHasComments">
                    <xsd:annotation>
                      <xsd:documentation>[Relationship deriving from FlowGraphHasComments needs to be serialized in full-form]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                  <xsd:element ref="comment" >
                    <xsd:annotation>
                      <xsd:documentation>[Target role-player]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                </xsd:choice>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <!-- Relationship: FlowGraphHasActors -->
          <xsd:element name="actors" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of FlowGraphHasActors</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:choice minOccurs="0" maxOccurs="unbounded" >
                  <xsd:element ref="flowGraphHasActors">
                    <xsd:annotation>
                      <xsd:documentation>[Relationship deriving from FlowGraphHasActors needs to be serialized in full-form]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                  <xsd:element ref="actor" >
                    <xsd:annotation>
                      <xsd:documentation>[Target role-player]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                </xsd:choice>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
        <!-- dslVersion -->
        <xsd:attribute name="dslVersion" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Version of the model serialized in this file.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- FlowGraph Moniker -->
  <xsd:element name="flowGraphMoniker" type="FlowGraphMoniker" substitutionGroup="namedElementMoniker" />
  <xsd:complexType name="FlowGraphMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for FlowGraph instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="NamedElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- FlowElement -->
  <xsd:element name="flowElement" abstract="true" type="FlowElement" substitutionGroup="namedElement" />
  <xsd:complexType name="FlowElement" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>Elements that can be connected by Flow links.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="NamedElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Relationship: Flow -->
          <xsd:element name="flowTo" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of Flow</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element ref="flow" minOccurs="0" maxOccurs="unbounded">
                  <xsd:annotation>
                    <xsd:documentation>[Instance of Flow needs to be serialized in full-form]</xsd:documentation>
                  </xsd:annotation>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
        <!-- Property: Description -->
        <xsd:attribute name="description" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- FlowElement Moniker -->
  <xsd:element name="flowElementMoniker" abstract="true" type="FlowElementMoniker" substitutionGroup="namedElementMoniker" />
  <xsd:complexType name="FlowElementMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for FlowElement instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="NamedElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ObjectFlowElement -->
  <xsd:element name="objectFlowElement" abstract="true" type="ObjectFlowElement" substitutionGroup="flowElement" />
  <xsd:complexType name="ObjectFlowElement" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>Elements that can be connected by ObjectFlow links.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="FlowElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Relationship: ObjectFlow -->
          <xsd:element name="objectFlowFrom" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of ObjectFlow</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element ref="objectFlow" minOccurs="0" maxOccurs="unbounded">
                  <xsd:annotation>
                    <xsd:documentation>[Instance of ObjectFlow needs to be serialized in full-form]</xsd:documentation>
                  </xsd:annotation>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ObjectFlowElement Moniker -->
  <xsd:element name="objectFlowElementMoniker" abstract="true" type="ObjectFlowElementMoniker" substitutionGroup="flowElementMoniker" />
  <xsd:complexType name="ObjectFlowElementMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ObjectFlowElement instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="FlowElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Task -->
  <xsd:element name="task" type="Task" substitutionGroup="objectFlowElement" />
  <xsd:complexType name="Task">
    <xsd:complexContent>
      <xsd:extension base="ObjectFlowElement">
        <!-- Property: Sort -->
        <xsd:attribute name="sort" type="TaskSort" />
        <!-- Property: NestedDiagram -->
        <xsd:attribute name="nestedDiagram" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Task Moniker -->
  <xsd:element name="taskMoniker" type="TaskMoniker" substitutionGroup="objectFlowElementMoniker" />
  <xsd:complexType name="TaskMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Task instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="ObjectFlowElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- StartPoint -->
  <xsd:element name="startPoint" type="StartPoint" substitutionGroup="flowElement" />
  <xsd:complexType name="StartPoint">
    <xsd:complexContent>
      <xsd:extension base="FlowElement">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- StartPoint Moniker -->
  <xsd:element name="startPointMoniker" type="StartPointMoniker" substitutionGroup="flowElementMoniker" />
  <xsd:complexType name="StartPointMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for StartPoint instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="FlowElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Endpoint -->
  <xsd:element name="endpoint" type="Endpoint" substitutionGroup="flowElement" />
  <xsd:complexType name="Endpoint">
    <xsd:complexContent>
      <xsd:extension base="FlowElement">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Endpoint Moniker -->
  <xsd:element name="endpointMoniker" type="EndpointMoniker" substitutionGroup="flowElementMoniker" />
  <xsd:complexType name="EndpointMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Endpoint instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="FlowElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- MergeBranch -->
  <xsd:element name="mergeBranch" type="MergeBranch" substitutionGroup="flowElement" />
  <xsd:complexType name="MergeBranch">
    <xsd:complexContent>
      <xsd:extension base="FlowElement">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- MergeBranch Moniker -->
  <xsd:element name="mergeBranchMoniker" type="MergeBranchMoniker" substitutionGroup="flowElementMoniker" />
  <xsd:complexType name="MergeBranchMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for MergeBranch instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="FlowElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Synchronization -->
  <xsd:element name="synchronization" type="Synchronization" substitutionGroup="flowElement" />
  <xsd:complexType name="Synchronization">
    <xsd:complexContent>
      <xsd:extension base="FlowElement">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Synchronization Moniker -->
  <xsd:element name="synchronizationMoniker" type="SynchronizationMoniker" substitutionGroup="flowElementMoniker" />
  <xsd:complexType name="SynchronizationMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Synchronization instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="FlowElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ObjectInState -->
  <xsd:element name="objectInState" type="ObjectInState" substitutionGroup="objectFlowElement" />
  <xsd:complexType name="ObjectInState">
    <xsd:complexContent>
      <xsd:extension base="ObjectFlowElement">
        <!-- Property: State -->
        <xsd:attribute name="state" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- ObjectInState Moniker -->
  <xsd:element name="objectInStateMoniker" type="ObjectInStateMoniker" substitutionGroup="objectFlowElementMoniker" />
  <xsd:complexType name="ObjectInStateMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ObjectInState instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="ObjectFlowElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Comment -->
  <xsd:element name="comment" type="Comment" />
  <xsd:complexType name="Comment">
    <xsd:annotation>
      <xsd:documentation>Can be attached to any task flow element.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Relationship: CommentReferencesSubjects -->
      <xsd:element name="subjects" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Instances of CommentReferencesSubjects</xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:choice minOccurs="0" maxOccurs="unbounded" >
              <xsd:element ref="commentReferencesSubjects">
                <xsd:annotation>
                  <xsd:documentation>[Relationship deriving from CommentReferencesSubjects needs to be serialized in full-form]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
              <xsd:element ref="flowElementMoniker" >
                <xsd:annotation>
                  <xsd:documentation>[Target role-player]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <!-- Id -->
    <xsd:attribute name="Id" type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: Text -->
    <xsd:attribute name="text" type="xsd:string" />
  </xsd:complexType>
  
  <!-- Comment Moniker -->
  <xsd:element name="commentMoniker" type="CommentMoniker" />
  <xsd:complexType name="CommentMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Comment instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="Id" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- Actor -->
  <xsd:element name="actor" type="Actor" substitutionGroup="namedElement" />
  <xsd:complexType name="Actor">
    <xsd:annotation>
      <xsd:documentation>Represented by a swim lane on the diagram.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="NamedElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Relationship: ActorHasFlowElements -->
          <xsd:element name="flowElements" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of ActorHasFlowElements</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:choice minOccurs="0" maxOccurs="unbounded" >
                  <xsd:element ref="actorHasFlowElements">
                    <xsd:annotation>
                      <xsd:documentation>[Relationship deriving from ActorHasFlowElements needs to be serialized in full-form]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                  <xsd:element ref="flowElement" >
                    <xsd:annotation>
                      <xsd:documentation>[Target role-player]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                </xsd:choice>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Actor Moniker -->
  <xsd:element name="actorMoniker" type="ActorMoniker" substitutionGroup="namedElementMoniker" />
  <xsd:complexType name="ActorMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Actor instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="NamedElementMoniker">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Flow -->
  <xsd:element name="flow" type="Flow" />
  <xsd:complexType name="Flow">
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end FlowElement -->
      <xsd:element ref="flowElementMoniker" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
    <!-- Property: Guard -->
    <xsd:attribute name="guard" type="xsd:string" />
  </xsd:complexType>
  
  <!-- Flow Moniker -->
  <xsd:element name="flowMoniker" abstract="true" type="FlowMoniker" />
  <xsd:complexType name="FlowMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Flow instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- FlowGraphHasComments -->
  <xsd:element name="flowGraphHasComments" abstract="true" type="FlowGraphHasComments" />
  <xsd:complexType name="FlowGraphHasComments" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end Comment -->
      <xsd:element ref="comment" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- FlowGraphHasComments Moniker -->
  <xsd:element name="flowGraphHasCommentsMoniker" abstract="true" type="FlowGraphHasCommentsMoniker" />
  <xsd:complexType name="FlowGraphHasCommentsMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for FlowGraphHasComments instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- FlowGraphHasActors -->
  <xsd:element name="flowGraphHasActors" abstract="true" type="FlowGraphHasActors" />
  <xsd:complexType name="FlowGraphHasActors" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>The set of actors (represented by swim lanes) in the task flow.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end Actor -->
      <xsd:element ref="actor" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- FlowGraphHasActors Moniker -->
  <xsd:element name="flowGraphHasActorsMoniker" abstract="true" type="FlowGraphHasActorsMoniker" />
  <xsd:complexType name="FlowGraphHasActorsMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for FlowGraphHasActors instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- CommentReferencesSubjects -->
  <xsd:element name="commentReferencesSubjects" abstract="true" type="CommentReferencesSubjects" />
  <xsd:complexType name="CommentReferencesSubjects" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end FlowElement -->
      <xsd:element ref="flowElementMoniker" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- CommentReferencesSubjects Moniker -->
  <xsd:element name="commentReferencesSubjectsMoniker" abstract="true" type="CommentReferencesSubjectsMoniker" />
  <xsd:complexType name="CommentReferencesSubjectsMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for CommentReferencesSubjects instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- ObjectFlow -->
  <xsd:element name="objectFlow" type="ObjectFlow" />
  <xsd:complexType name="ObjectFlow">
    <xsd:annotation>
      <xsd:documentation>Relationship between Tasks and ObjectInStates.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end ObjectFlowElement -->
      <xsd:element ref="objectFlowElementMoniker" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- ObjectFlow Moniker -->
  <xsd:element name="objectFlowMoniker" abstract="true" type="ObjectFlowMoniker" />
  <xsd:complexType name="ObjectFlowMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ObjectFlow instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- ActorHasFlowElements -->
  <xsd:element name="actorHasFlowElements" abstract="true" type="ActorHasFlowElements" />
  <xsd:complexType name="ActorHasFlowElements" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end FlowElement -->
      <xsd:element ref="flowElement" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- ActorHasFlowElements Moniker -->
  <xsd:element name="actorHasFlowElementsMoniker" abstract="true" type="ActorHasFlowElementsMoniker" />
  <xsd:complexType name="ActorHasFlowElementsMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ActorHasFlowElements instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- Enum TaskSort -->
  <xsd:simpleType name="TaskSort">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="Regular"/>
      <xsd:enumeration value="SuperTask"/>
    </xsd:restriction>
  </xsd:simpleType>
  
</xsd:schema>

